package cn.blu10ph.tools.web_ctrl;

import java.awt.*;
import java.awt.event.KeyEvent;

public class KeyMsgSend {

    protected static Robot robot;

    public KeyMsgSend(){
        try {
            robot = new Robot();
        } catch (AWTException awtEx) {
            System.out.println(awtEx.getMessage());
        }
    }

    public void enter(){
        System.out.println("enter");
        robot.keyPress(KeyEvent.VK_ENTER);
        robot.keyRelease(KeyEvent.VK_ENTER);
    }

    public void page_up(){
        System.out.println("page_up");
        robot.keyPress(KeyEvent.VK_PAGE_UP);
        robot.keyRelease(KeyEvent.VK_PAGE_UP);
    }

    public void page_down(){
        System.out.println("page_down");
        robot.keyPress(KeyEvent.VK_PAGE_DOWN);
        robot.keyRelease(KeyEvent.VK_PAGE_DOWN);
    }
}
